package cn.iocoder.yudao.module.ride.dal.mysql.membergrowthrecord;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ride.dal.dataobject.membergrowthrecord.MemberGrowthRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ride.controller.admin.membergrowthrecord.vo.*;

/**
 * 会员成长值变动记录 Mapper
 *
 * @author tong
 */
@Mapper
public interface MemberGrowthRecordMapper extends BaseMapperX<MemberGrowthRecordDO> {

    default PageResult<MemberGrowthRecordDO> selectPage(MemberGrowthRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberGrowthRecordDO>()
                .eqIfPresent(MemberGrowthRecordDO::getUserType, reqVO.getUserType())
                .eqIfPresent(MemberGrowthRecordDO::getReason, reqVO.getReason())
                .betweenIfPresent(MemberGrowthRecordDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberGrowthRecordDO::getId));
    }

}